package com.biwin.module.org.domain.entity;


import com.biwin.module.orm.api.entity.BwBasicEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import java.util.Date;

/**
 * System user entity 系统用户
 *
 * @author biwin
 * @since 0.0.1
 */
@Entity
@Table(name = "system_user", indexes = {@Index(name = "unique_account", columnList = "account", unique = true)})
@org.hibernate.annotations.Table(appliesTo = "system_user", comment = "系统用户表")
public class SystemUser extends BwBasicEntity {

    private static final long serialVersionUID = -3916134921813014999L;
    @Column(name = "account", columnDefinition = "VARCHAR(20) NOT NULL COMMENT '登录账号'")
    private String account;

    @Column(name = "sex", columnDefinition = "TINYINT(1) NOT  NULL DEFAULT 0 COMMENT '性别'")
    private Integer sex;

    @Column(name = "name", columnDefinition = "VARCHAR(50) NOT NULL COMMENT '姓名'")
    private String name;

    @Column(name = "password", columnDefinition = "VARCHAR(100) NOT NULL COMMENT '密码'")
    private String password;

    @Column(name = "pwd_fault_num", columnDefinition = "INT NOT NULL DEFAULT 0 COMMENT '密码试错次数'")
    private Integer passwordFaultNum;

    @Column(name = "pwd_last_modify_date", columnDefinition = "DATETIME COMMENT '密码最后修改时间'")
    private Date passwordLastModifyDate;

    @Column(name = "last_login_date", columnDefinition = "DATETIME COMMENT '上次登录时间'")
    private Date lastLoginDate;

    @Column(name = "locked", columnDefinition = "BIT(1) NOT NULL DEFAULT B'0' COMMENT '账户是否锁定'")
    private Boolean locked;

    @Column(name = "effective", columnDefinition = "BIT(1) NOT NULL DEFAULT B'1' COMMENT '账户是否有效'")
    private Boolean effective;

    @Column(name = "tel", columnDefinition = "VARCHAR(15) COMMENT '联系电话'")
    private String tel;

    @Column(name = "direct_org", columnDefinition = "BIGINT(20) NOT NULL COMMENT '直属组织' ")
    private Long directOrganization;

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getPasswordFaultNum() {
        return passwordFaultNum;
    }

    public void setPasswordFaultNum(Integer passwordFaultNum) {
        this.passwordFaultNum = passwordFaultNum;
    }

    public Date getPasswordLastModifyDate() {
        return passwordLastModifyDate;
    }

    public void setPasswordLastModifyDate(Date passwordLastModifyDate) {
        this.passwordLastModifyDate = passwordLastModifyDate;
    }

    public Date getLastLoginDate() {
        return lastLoginDate;
    }

    public void setLastLoginDate(Date lastLoginDate) {
        this.lastLoginDate = lastLoginDate;
    }

    public Boolean getLocked() {
        return locked;
    }

    public void setLocked(Boolean locked) {
        this.locked = locked;
    }

    public Boolean getEffective() {
        return effective;
    }

    public void setEffective(Boolean effective) {
        this.effective = effective;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public Long getDirectOrganization() {
        return directOrganization;
    }

    public void setDirectOrganization(Long directOrganization) {
        this.directOrganization = directOrganization;
    }
}
